<?php

ini_set('auto_detect_line_endings', true);


// Create database connection

$db = new PDO('mysql:host=192.168.0.41;dbname=sherpaou_website', 'sherpaou_website', 'Jm472PrSt', array(
//$db = new PDO('mysql:host=localhost;dbname=sherpaou_website', 'root', '', array(
	'PDO::ATTR_PERSISTENT'	=> true
));
$db->exec('SET CHARACTER SET utf8');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
$db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);


// Functions

function nullify($data) {
	return ($data == '' || $data == 'NULL') ? null : $data;
}